#!/bin/bash
#
#
# Author:       Ednei Leite Leite da Silva
#
# chkconfig:    1000 50 50
#
# processname:  ServidorFirewall
#
RETVAL=0;
 
start() {
modprobe ip_conntrack 
modprobe ip_conntrack_ftp 
modprobe ip_nat_ftp
modprobe ip_queue
modprobe ip_tables 
modprobe ipt_LOG 
modprobe ipt_MARK 
modprobe ipt_MASQUERADE
modprobe ipt_MIRROR
modprobe ipt_REDIRECT
modprobe ipt_REJECT
modprobe ipt_TCPMSS
modprobe ipt_TOS
modprobe ipt_limit 
modprobe ipt_mac
modprobe ipt_mark
modprobe ipt_multiport
modprobe ipt_owner
modprobe ipt_state
modprobe ipt_tcpmss 
modprobe ipt_tos
modprobe ipt_unclean
modprobe iptable_filter
modprobe iptable_mangle
modprobe iptable_nat

@prefix@/bin/serverfw &

iptables-restore < @prefix@/firewall
}
 
stop() {
PS=`ps -C "serverfw" | egrep serverfw`
set -- $PS
kill $1
}
 
restart() {
stop
start
}
 
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
 
exit $RETVAL
